package com.boco.blch.analysiser.compliance.HW.manager;

import java.util.regex.Pattern;

import com.boco.blch.analysiser.compliance.ComplianceResolved;

public class BOCO_ZooKeeper_VersionManage_CycleUpdate implements ComplianceResolved{

	@Override
	public int realEchoResolved(String echoResult) {
		String[] echoResult1=echoResult.split("\n");
		String newVersion="3.5.3";
		String str="";
		//判断数字 正则
		Pattern pattern = Pattern.compile("version=\\d.\\d.\\d"); 
		if(echoResult != null && echoResult.trim().length() > 0){
			for(int i=0;i<echoResult1.length;i++){
				boolean flag = pattern.matcher(echoResult1[i].trim()).matches();
				if(flag){
					str=echoResult1[i].trim();
				}
			}
			String[] str1=str.split("=");
			String value=str1[1];
			if(value.trim().equals(newVersion.trim())){
				return SUCCESS;
			}
		}
		return FAILED;
	}

	

}
